/**
 * 
 */
package com.tdkj.action.backstage.admin;

import org.hibernate.Criteria;
import org.hibernate.criterion.Order;

import com.tdkj.action.BaseAction;
import com.tdkj.model.user.BeanAdminLog;

/**
 * @author lxj
 * 
 */
public class AdminLogAction extends BaseAction {
	private static final long serialVersionUID = 6327370724187230237L;
	private String optionId;
	private String[] ids;

	public String defultQuery() {
		Criteria criteria = this.createCriteria(BeanAdminLog.class);
		criteria.addOrder(Order.desc("createtime"));// 对状态进行排序
		this.queryByPage(criteria, "adminLogAction!defultQuery.action", 10);
		return "defultQuery";
	}

	public String pageQuery() {

		return "defultQuery";
	}

	public String deleteLog() {
		this.getBaseService().delete(Long.parseLong(optionId), BeanAdminLog.class);
		return defultQuery();
	}

	public String deleteAll() {
		if (null != ids) {
			for (String idtemp : ids) {
				this.getBaseService().delete(Long.parseLong(idtemp), BeanAdminLog.class);
			}
		}
		return defultQuery();
	}

	public String getOptionId() {
		return optionId;
	}

	public void setOptionId(String optionId) {
		this.optionId = optionId;
	}

	public String[] getIds() {
		return ids;
	}

	public void setIds(String[] ids) {
		this.ids = ids;
	}

}
